package it.traveldream.EJB.entities;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the stati database table.
 * 
 */
@Entity
@NamedQuery(name="Stati.findAll", query="SELECT s FROM Stati s")
public class Stati implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String code;

	private String continent;

	private String name;

	private String region;

	//bi-directional many-to-one association to Citta
	@OneToMany(mappedBy="stati")
	private List<Citta> cittas;

	public Stati() {
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getContinent() {
		return this.continent;
	}

	public void setContinent(String continent) {
		this.continent = continent;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRegion() {
		return this.region;
	}

	public void setRegion(String region) {
		this.region = region;
	}

	public List<Citta> getCittas() {
		return this.cittas;
	}

	public void setCittas(List<Citta> cittas) {
		this.cittas = cittas;
	}

	public Citta addCitta(Citta citta) {
		getCittas().add(citta);
		citta.setStati(this);

		return citta;
	}

	public Citta removeCitta(Citta citta) {
		getCittas().remove(citta);
		citta.setStati(null);

		return citta;
	}

}